import type { AttachmentLink, ActionButton, FriendLink } from '@/lib/types/bottom-navigation'

// 友情链接数据配置
export const FRIEND_LINKS: FriendLink[] = [
  {
    icon2: "https://res.hello123.com/huasen-store/logo/favicon.png",
    title2: "Hello123",
    link2: "https://www.hello123.com",
    desc2: "Hello123工具导航"
  },
  {
    icon2: "https://res.hello123.com/logo/ilovefree-logo.png",
    title2: "ilovefree",
    link2: "https://free.hello123.com",
    desc2: "免费资源"
  }
]

/**
 * 底部导航组件常量配置
 * 集中管理所有配置项和默认值
 */

// 受信任的域名列表
export const TRUSTED_DOMAINS = [
  'hello123.com',
  'todo.hello123.com',
  'game.hello123.com',
  'max.hello123.com',
  'www.hello123.com',
  'mini.hello123.com'
] as const

// 外部链接配置
export const ATTACHMENT_LINKS: AttachmentLink[] = [
  {
    id: 'todo',
    title: '免费资源',
    href: 'https://free.hello123.com',
    target: '_blank',
    rel: 'noopener'
  },
  {
    id: 'blog',
    title: 'hello123工具导航',
    href: 'https://www.hello123.com',
    target: '_blank',
    rel: 'noopener'
  }
]

// 操作按钮配置
export const ACTION_BUTTONS: ActionButton[] = [
  {
    id: 'usage',
    title: '使用方法',
    type: 'dialog',
    dialogType: 'usage'
  },
  {
    id: 'payment',
    title: '打赏',
    type: 'dialog',
    dialogType: 'payment'
  },
  {
    id: 'main-site',
    title: '免费资源',
    type: 'link',
    href: 'https://free.hello123.com',
    target: '_blank',
    rel: 'noopener'
  },
  {
    id: 'friendLinks',
    title: '友情链接',
    type: 'dialog',
    dialogType: 'friendLinks'
  },
  {
    id: 'about',
    title: '关于我们',
    type: 'dialog',
    dialogType: 'about'
  }
]

// 弹窗尺寸配置
export const DIALOG_SIZES = {
  usage: { width: 600, height: 400 },
  payment: { width: 380, height: 320 },
  friendLinks: { width: 500, height: 400 },
  about: { width: 600, height: 320 }
} as const

// 样式主题配置
export const BOTTOM_NAV_STYLES = {
  spacing: {
    containerPadding: 'px-4 py-6',
    sectionGap: 'gap-8',
    buttonGap: 'gap-4',
    itemPadding: 'px-3 py-2',
    // 附件链接专用间距（对应原版CSS）
    attachmentBoxMargin: 'mt-8 mb-8', // 原版: margin-top: 30px; margin-bottom: 30px;
    boxListMargin: 'mx-2.5 mb-5' // 原版: margin: 0px 10px 20px;
  },
  colors: {
    linkDefault: 'text-foreground',
    linkHover: 'hover:text-primary',
    buttonDefault: 'text-muted-foreground',
    buttonHover: 'hover:text-foreground hover:bg-accent',
    buttonActive: 'bg-accent text-accent-foreground',
    // 附件链接专用颜色（对应原版CSS）
    attachmentLinkDefault: 'text-[#02a3ff]', // 原版默认蓝色
    attachmentLinkHover: 'hover:text-[#1E9FFF]', // 原版悬停蓝色
    attachmentLinkBackground: 'bg-white', // 白色背景
    attachmentLinkBackgroundHover: 'hover:bg-gray-50' // 悬停浅灰背景
  },
  layout: {
    container: 'flex flex-col items-center justify-center w-full',
    attachmentBox: 'flex justify-between items-center w-full max-w-4xl mb-4',
    actionButtons: 'flex flex-wrap justify-center items-center',
    responsive: {
      mobile: 'flex-col gap-2',
      tablet: 'flex-row gap-4',
      desktop: 'flex-row gap-6'
    },
    // 附件链接专用布局（对应原版CSS）
    attachmentContainer: 'w-60 mx-auto', // 原版: width: 240px; margin: auto;
    attachmentBoxNew: 'flex justify-between', // 左右分布
    boxList: 'w-[100px] overflow-hidden rounded-[22.5px] shadow-[0_0_25px_rgba(78,70,70,0.16)] border-[6px] border-white',
    linkInner: 'inline-block w-full text-center h-[50px] leading-[50px] -mt-px text-[17px]'
  },
  animation: {
    button: 'transition-all duration-200 ease-in-out',
    dialog: 'animate-in fade-in-0 zoom-in-95',
    overlay: 'animate-in fade-in-0',
    // 附件链接动画
    attachment: 'transition-all duration-300' // 对应原版 transition
  }
} as const

// 弹窗内容文本配置
export const DIALOG_CONTENT = {
  usage: {
    title: '使用方法',
    content: `
1、免登录即可自定义网址，只需要点击网页右上方的设置按钮，输入网址即可。

2、按回车键是使用默认搜索引擎，有两个默认搜索引擎：百度/Google。点击输入框左侧的圆形图片logo即可切换默认搜索引擎。

3、输入框上方的"Hello123"logo标识支持翻转，背面有完整版导航按钮。`
  },
  payment: {
    title: '客官，谢谢打赏 ^_^',
    alipayImage: 'https://res.hello123.com/pay/alipay.png',
    wechatPayImage: 'https://res.hello123.com/pay/weixinpay.png'
  },
  friendLinks: {
    title: '友情链接',
    description: '加我微信，交换友情链接：yuanyuanzhenmei8'
  },
  about: {
    title: '关于我们',
    content: `Hello123——上网不迷路，Hello123。是一个简单美观的搜索导航页面，是一个聚合多个搜索引擎和多个站内搜索在一起的页面，为您的全网搜索提供便利！

如果你有什么不懂得地方或者对Hello123导航有一些建议，可以使用以下方式联系我，我一定及时回复，谢谢！

`,
    contacts: {
      qq: '3258433521',
      email: '3258433521@qq.com',
      emailUrl: 'http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=3258433521@qq.com',
      wechatPersonal: {
        wechatId: 'yuanyuanzhenmei8',
        qrCodeUrl: 'https://res.hello123.com/logo/wechat.png'
      },
      wechatOfficialAccount: {
        name: 'Hello123网站',
        qrCodeUrl: 'https://res.hello123.com/logo/weixin_mp_gzh.jpg'
      }
    }
  }
} as const

// 默认状态配置
export const DEFAULT_BOTTOM_NAV_STATE = {
  activeDialog: null,
  isLoading: false,
  lastInteraction: null
} as const

// 埋点事件名称
export const TRACKING_EVENTS = {
  ATTACHMENT_LINK_CLICK: 'bottom_nav_attachment_click',
  ACTION_BUTTON_CLICK: 'bottom_nav_action_click',
  DIALOG_OPEN: 'bottom_nav_dialog_open',
  DIALOG_CLOSE: 'bottom_nav_dialog_close',
  EXTERNAL_LINK_CLICK: 'bottom_nav_external_link_click'
} as const 